
import lodash from 'lodash'
export default async ({ forms }: any) => {
    if (lodash.isArray(forms)) {
        const errors = await Promise.all(
            lodash.chain(forms)
                .map((form: any) => {
                    return new Promise((resolve) => {
                        form.validateFields()
                            .then(() => resolve([]))
                            .catch((errorInfo) => resolve(errorInfo));
                    });
                })
                .value()
        );

        return errors
    }
    return []
}